package com.zhuoshi.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhuoshi.entity.Receive;
import com.zhuoshi.entity.ReveiceCustom;
import com.zhuoshi.mapper.ReceiveMapper;
import com.zhuoshi.service.ReceiveService;

/*
 * Author 海生
 * 
 * 
 */
@Service
@Transactional
public class ReceiveServiceImpl implements ReceiveService{
	
	@Autowired
	private ReceiveMapper receiveMapper;
	//查询所有的销售机会
	public List<Receive> selectAlljiedaijilu() throws Exception {
		List<Receive> receiveList = receiveMapper.selectAlljiedaijilu();
		return receiveList;
	}
	
	//查询项目Project，楼栋Complex 单元Unit 房间Room 等信息显示
	public List<ReveiceCustom> selectProjectComplexUnitRoom() {
		List<ReveiceCustom> reveiceCustomList = receiveMapper.selectProjectComplexUnitRoom();
		return reveiceCustomList;
	}

	//确认添加销售机会
	public int QuerenAddXiaoShouJiHui(Receive receive) {
		int rows = receiveMapper.insert(receive);
		return rows;
	}

	//删除销售机会
	public int deleteXiaoShouJiHui(int id) {
		int rows= receiveMapper.deleteByPrimaryKey(id);
		return rows;
	}

	public Receive selectById(int id) {
		return receiveMapper.selectByPrimaryKey(id);
		
	}

}
